package com.example.community.dao;

import com.example.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;

/**
 * @Author: huang
 * @Date: 2021/9/22 10:11
 * @Description:
 */
@Mapper
public interface CommentMapper {

    //查询评论,还需分页查询
    List<Comment> selectCommentsByEntity(@Param("entityType") int entityType,@Param("entityId") int entityId,@Param("offset") int offset,@Param("limit") int limit);

    //查询评论总数量，计算总页数相关的。
    int selectCountByEntity(@Param("entityType") int entityType,@Param("entityId") int entityId);

    //添加评论
    int insertComment(Comment comment);

    //
    Comment selectCommentById(int id);
}

